Mobile device and microcontroller unit

ABSTRACT

A microcontroller unit (MCU) characterized by including a buffer is provided. The MCU is a part of a mobile device. The MCU fetches a plurality of samples from a sensor of the mobile device, performs a preset processing according to the samples, stores the samples and/or a result of the preset processing in the buffer, and provides the result or a signal based on the result to the central processing unit (CPU) of the mobile device or an electronic device.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation-in-part application of and claims thepriority benefit of a prior U.S. application Ser. No. 13/945,930, filedon Jul. 19, 2013 now pending. This application is also acontinuation-in-part application of and claims the priority benefit of aprior U.S. application Ser. No. 14/033,553, filed on Sep. 24, 2013 nowpending. The prior U.S. application Ser. No. 14/033,553 claims thepriority benefit of China application serial no. 201320245496.X, filedon May 8, 2013. The entirety of each of the above-mentioned patentapplications is hereby incorporated by reference herein and made a partof this specification.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to a microcontroller unit (MCU) of amobile device. More particularly, the present invention relates to anMCU including a buffer for storing samples for further processing and/orresults of the processing.

Description of the Related Art

Nowadays a mobile device is often equipped with embedded sensors, suchas accelerometer, gyro-sensor and magnetometer. The central processingunit (CPU) of the mobile device can collect samples generated by thesensors and perform some processing based on the samples. For example,the CPU can calculate the movement and the orientation of the mobiledevice or calculate how many steps the user of the mobile device haswalked.

Since the sensors keep generating samples, the CPU has to receive andanalyse the samples constantly. Therefore, the CPU has to be in its fulloperation mode for extended periods of time, which consumes electricpower and shortens the battery life of the mobile device.

SUMMARY OF THE INVENTION

Accordingly, the present invention is directed to a mobile device and anMCU of such a mobile device. The mobile device delegates the task ofcollecting and analysing the samples generated by the sensor to the MCUto reduce power consumption.

According to an embodiment of the present invention, a mobile device isprovided. The mobile device includes a sensor, an MCU and a CPU. Thesensor generates a plurality of samples. The MCU is coupled to thesensor. The MCU includes a buffer. The MCU fetches the samples from thesensor, performs a first preset processing according to the samples, andstoring the samples and/or a result of the first preset processing inthe buffer. The CPU is coupled to the MCU. The CPU fetches the resultfrom the MCU or receives a signal based on the result from the MCU. TheCPU performs a second preset processing according to the result or thesignal.

According to another embodiment of the present invention, a mobiledevice is provided. The mobile device includes a sensor and an MCU. Thesensor generates a plurality of samples. The MCU is coupled to thesensor. The MCU includes a buffer. The MCU fetches the samples from thesensor, performs a preset processing according to the samples, storesthe samples and/or a result of the preset processing in the buffer, andprovides the result or a signal based on the result to an electronicdevice.

According to another embodiment of the present invention, an MCUcharacterized by including a buffer is provided. The MCU fetches aplurality of samples from a sensor, performs a preset processingaccording to the samples, stores the samples and/or a result of thepreset processing in the buffer, and provides the result or a signalbased on the result to an electronic device.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a furtherunderstanding of the invention, and are incorporated in and constitute apart of this specification. The drawings illustrate embodiments of theinvention and, together with the description, serve to explain theprinciples of the invention.

FIG. 1 is a schematic diagram showing a mobile device according to anembodiment of the present invention.

FIG. 2 is a schematic diagram showing a mobile device according toanother embodiment of the present invention.

FIG. 3 is a schematic diagram showing a mobile device according toanother embodiment of the present invention.

DESCRIPTION OF THE EMBODIMENTS

Reference will now be made in detail to the present embodiments of theinvention, examples of which are illustrated in the accompanyingdrawings. Wherever possible, the same reference numbers are used in thedrawings and the description to refer to the same or like parts.

FIG. 1 is a schematic diagram showing a mobile device 100 according toan embodiment of the present invention. The mobile device 100 may be aremote controller, a smart phone, a personal digital assistant (PDA), atablet computer, or a notebook computer, etc. The mobile device 100includes a sensor 110, an MCU 120, and a CPU 130. The MCU 120 is coupledto the sensor 110. The CPU 130 is coupled to the MCU 120. The sensor 110includes a buffer 115. The MCU 120 includes a buffer 125. The buffers115 and 125 are storage devices, such as register or memory.

The sensor 110 generates a plurality of samples. The sensor 110 maystore the samples in the buffer 115. The MCU 120 fetches the samplesfrom the sensor 110 and performs an initial preset processing accordingto the samples to generate one or more results of the initial presetprocessing. The MCU 120 may store either the samples or the result(s) inthe buffer 125. Alternatively, the MCU 120 may store both the samplesand the result(s) in the buffer 125.

The CPU 130 fetches the one or more results from the MCU 120 or receivesa signal based on the one or more results from the MCU 120. The CPU 130performs further preset processing according to the one or more resultsor the signal from the MCU 120.

In an embodiment of the present invention, the sensor 110 generates thesamples at a frequency F₁, which means the sensor 110 generates F₁samples every second. The MCU 120 fetches the samples from the sensor110 in batches at a frequency F₂. The CPU 130 fetches the results fromthe MCU 120 in batches at a frequency F₃. The frequency F₁ may be higherthan or equal to the frequency F₂. The frequency F₂ may be higher thanor equal to the frequency F₃.

For example, F₁ may be 2000 Hz, F₂ may be 1 Hz, and F₃ may be 0.001 Hz.The sensor 110 generates 2000 samples every second. The MCU 120 fetchesthe samples from the sensor 110 once in every second. In each fetching,the MCU 120 fetches the 2000 samples as a single batch from the sensor110. After each fetching, the MCU 120 performs the initial presetprocessing and generates 40 results based on the 2000 samples. The CPU130 fetches the 40 results as a single batch from the MCU 120 once every1000 seconds. After each fetching, the CPU 130 performs further presetprocessing according to the 40 results. This batch fetching mechanismalleviates the burden of obtaining samples of the MCU 120 because theMCU 120 does not have to fetch the samples one by one from the sensor110. Similarly, this batch fetching mechanism alleviates the burden ofobtaining results of the CPU 130 because the CPU 130 does not have tofetch the results one by one from the MCU 120.

The CPU 130 executes the operating system (OS) and the applications ofthe mobile device 100. The further preset processing is just one of manytasks performed by the CPU 130. The MCU 120 is exclusively dedicated toperforming the initial preset processing according to the samples andproviding the one or more results or the signal to the CPU 130. The CPU130 has much more processing power than the MCU 120 does and the CPU 130consumes much more electric power than the MCU 120 does. The MCU 120takes over the burden of collecting the samples from the sensor 110 andperforming the initial preset processing from the CPU 130 so that theCPU 130 can sleep as long as possible in order to save power and extendthe battery life of the mobile device 100. The batch fetching of resultsfrom the MCU 120 helps to reduce the waking frequency of the CPU 130,which saves more power. The MCU 120 constantly polls the sensor 110 andfetches the samples from the sensor 110. The MCU 120 never sleeps.

The CPU 130 may sleep until the CPU 130 wakes up to fetch the resultfrom the MCU 120 or until the CPU 130 is woke up by the signal from theMCU 120. The MCU 120 may wake up the CPU 130 and notifies the CPU 130 tofetch the result from the MCU 120. Alternatively, the CPU 130 may wakeup when the user of the mobile device 100 launches an application orwhen a timer expires. In other words, the CPU 130 may wake up withoutnotification from the MCU 120, and then the CPU 130 may fetch the one ormore results from the MCU 120.

FIG. 2 is a schematic diagram showing a mobile device 200 according toanother embodiment of the present invention. The mobile device 200includes the CPU 130, the MCU 120, and seven sensors 201-207, namely,the accelerometer 201, the gyro-sensor 202, the magnetometer 203, thebarometer 204, the touch panel 205, the microphone 206, and the lightsensor 207. The accelerometer 201 generates samples of accelerationsassociated with movements and rotations of the mobile device 200. Thegyro-sensor 202 generates samples of angular velocities associated withmovements and rotations of the mobile device 200. The magnetometer 203generates samples of magnetism associated with movements and rotationsof the mobile device 200. The barometer 204 generates samples ofatmospheric pressures associated with movements and rotations of themobile device 200. The touch panel 205 generates samples of locationstouched by the user of the mobile device 200. The microphone 206generates samples of sound around the mobile device 200. The lightsensor 207 generates samples of the ambient brightness around the mobiledevice 200. Each of the sensors 201-207 may include a buffer as thesensor 110 does.

The MCU 120 is coupled to all of the sensors 201-207 and operates as asensor hub. Each subset of the mobile device 200 including the CPU 130,the MCU 120, and one of the sensors 201-207 may operate in the same waysas the mobile device 100 shown in FIG. 1 does. In addition, the MCU 120and the CPU 130 may perform preset processing based on samples generatedby multiple sensors altogether. In another embodiment of the presentinvention, the mobile device 200 may include less than seven sensors ormore than seven sensors.

In an embodiment of the present invention, the mobile device 200 mayprovide the function of a pedometer. The MCU 120 fetches the samplesfrom the accelerometer 201 and performs the initial preset processing bycalculating how many steps the user of the mobile device 200 has walkedaccording to the samples. The MCU 120 may store the result of theinitial preset processing, namely, the number of steps, in the buffer125.

The MCU 120 may wake up the CPU 130 to fetch the result every N steps,wherein N is a preset positive integer. Alternatively, the CPU may wakeup periodically to fetch the result from the MCU 120. Alternatively, theCPU may wake up whenever the user launches an application to see thenumber of steps. The infrequent awakening of the CPU 130 saves energy.Sometimes the user walks for hours and does not want to see the numberof steps until the user arrives at home. In this case, the CPU 130 maysleep for hours and saves a lot of energy.

In addition to counting the number of steps, the initial presetprocessing performed by the MCU 120 may include calculating thedirection and the distance of each step of the user according to thesamples generated by the accelerometer 201, the gyro-sensor 202, and themagnetometer 203. The MCU 120 may store the results, namely, thedirections and distances of the steps, in the buffer 125. The MCU 120may wake up the CPU 130 and notifies the CPU 130 to fetch the resultswhen the size of the results reaches a preset percentage of the capacityof the buffer 125.

When the CPU 130 wakes up, the further preset processing performed bythe CPU 130 may include displaying the number of steps, displaying achart showing the number of steps in each hour, or plotting the trace ofthe user according to the directions and the distances of the steps,etc.

In another embodiment of the present invention, the mobile device 200may provide functions of positioning and navigation based on the GlobalPositioning System (GPS). The user may turn off the GPS function to savepower. The CPU 130 sleeps when the GPS function is turned off. Duringthe period when the GPS function is turned off, the MCU 120 may fetchthe samples generated by the accelerometer 201, the gyro-sensor 202, andthe magnetometer 203 to calculate the moving trace of the mobile device200. The MCU 120 may store the moving trace in the buffer 125 as theresult of the initial preset processing. When the user turns on the GPSfunction, the CPU 130 may fetch the moving trace from the MCU 120 anduse the moving trace and the last GPS position of the mobile device 200to calculate a reference position so that the CPU 130 can find thecurrent GPS position of the mobile device 200 faster.

In another embodiment of the present invention, the MCU 120 maycalculate the moving trace of the mobile device 200 according to thesamples generated by the barometer 204 in addition to the samplesgenerated by the accelerometer 201, the gyro-sensor 202, and themagnetometer 203, so that the moving trace can include more accurateestimation of the change of altitude of the mobile device 200.

In another embodiment of the present invention, the mobile device 200may switch between an unlocked state and a locked state. The mobiledevice 200 receives input from the touch panel 205 normally in theunlocked state, while the mobile device 200 does not receive input fromthe touch panel 205 in the locked state. The CPU 130 sleeps in thelocked state. For example, the mobile device 200 may enter the lockedstate from the unlocked state when the mobile device 200 has been idlefor a preset period of time, and the mobile device 200 may return to theunlocked state when the user performs a preset operation on the mobiledevice 200.

The preset operation for unlocking the mobile device 200 may be drawinga preset trace on the touch panel 205. In this case, the MCU 200 mayfetch the samples generated by the touch panel 205 and analyse thesamples to determine whether the user draws the preset trace or not.When the user finishes the preset trace on the touch panel 205, the MCU120 may send a signal, such as an interrupt, to wake up the CPU 130. TheCPU 130 switches the mobile device 200 from the locked state to theunlocked state in response to the signal.

Alternatively, the preset operation for unlocking the mobile device 200may be speaking a preset password to the microphone 206. In this case,the MCU 200 may fetch the samples generated by the microphone 206 andperform speech recognition on the samples to determine whether the userspeaks the preset password or not. When the user speaks the presetpassword to the microphone 206, the MCU 120 may send a signal to wake upthe CPU 130. The CPU 130 switches the mobile device 200 from the lockedstate to the unlocked state in response to the signal.

Alternatively, the preset operation for unlocking the mobile device 200may be holding the mobile device 200 and moving the mobile device 200along a preset trace. In this case, the MCU 200 may fetch the samplesgenerated by the accelerometer 201, the gyro-sensor 202, and themagnetometer 203 and analyse the samples to determine whether the mobiledevice 200 has moved along the preset trace or not. When the mobiledevice 200 has moved along the preset trace, the MCU 120 may send asignal to wake up the CPU 130. The CPU 130 switches the mobile device200 from the locked state to the unlocked state in response to thesignal.

In another embodiment of the present invention, the mobile device 200may include a display. The MCU 120 may fetch the samples generated bythe light sensor 207 and analyse the samples to calculate the averageambient brightness of the mobile device 200 over a recent period of timewith a predetermined length. The MCU 120 may store the average ambientbrightness in the buffer 125. The CPU 130 may fetch the average ambientbrightness periodically and adjusts the display brightness of thedisplay according to the average ambient brightness.

FIG. 3 is a schematic diagram showing a mobile device 320 according toanother embodiment of the present invention. The mobile device 320includes the MCU 120 and the sensors 201-207. Similar to the previousembodiments, the MCU 120 may fetch the samples generated by one or moreof the sensors 201-207 and performs the initial preset processingaccording to the samples. The MCU 120 may store the samples and/or theresult(s) of the initial preset processing in the buffer 125. The MCU120 in this embodiment is configured to connect to the electronic device340 through a wireless connection or a wired connection. The MCU 120 isfurther configured to provide the result(s) of the initial presetprocessing to the electronic device 340 through the wireless connectionor the wired connection. The electronic device 340 may perform furtherpreset processing according to the one or more results. In some aspects,the electronic device 340 is analogous to the CPU 130 in the previousembodiments.

For example, the mobile device 320 may be a wearable electronicpedometer. The MCU 120 counts the number of steps walked by the useraccording to the samples generated by the accelerometer 201. The MCU 120may store the number of steps in the buffer 125. In addition, the MCU120 may provide the number of steps to the electronic device 340 forfurther viewing or processing.

For another example, the mobile device 320 may be a small deviceattachable to a palm or an arm of a user or a golf stick wielded by theuser. When the user plays golf, the MCU 120 may fetch the samplesgenerated by the accelerometer 201, the gyro-sensor 202, and themagnetometer 203 to calculate the number of swings of the golf stickmade by the user. The MCU 120 may store the number of swings in thebuffer 125. In addition, the MCU 120 may provide the number of swings tothe electronic device 340 for further viewing or processing.

Alternatively, the MCU may analyse the samples generated by theaccelerometer 201, the gyro-sensor 202, and the magnetometer 203 toobtain the time and force of each swing of the golf stick made by theuser. The MCU 120 may store the results of the analysis in the buffer125. In addition, the MCU 120 may provide the results of the analysis tothe electronic device 340 for further viewing or processing.

In summary, the MCU provided by the present invention is a sensor hubwith a buffer. The MCU can take over the burden of collecting andanalysing the samples generated by the sensors from the CPU of a mobiledevice. As a result, the MCU alleviates the burden of the CPU and theCPU may sleep as long as possible to save energy and extend the batterylife of the mobile device.

It will be apparent to those skilled in the art that variousmodifications and variations can be made to the structure of the presentinvention without departing from the scope or spirit of the invention.In view of the foregoing, it is intended that the present inventioncover modifications and variations of this invention provided they fallwithin the scope of the following claims and their equivalents.

What is claimed is:
 1. A mobile device, comprising: a sensor, generating a plurality of samples; a microcontroller unit (MCU), coupled to the sensor, comprising a first buffer, fetching the samples from the sensor, performing a first preset processing according to the samples, and storing the samples and/or a result of the first preset processing in the first buffer; and a central processing unit (CPU), coupled to the MCU, fetching the result from the MCU or receiving a signal based on the result from the MCU, and performing a second preset processing according to the result or the signal; wherein the result or the samples are fetched in batches so as to reduce power consumption.
 2. The mobile device of claim 1, wherein the sensor generates the samples at a first frequency, the MCU fetches the samples from the sensor in batches at a second frequency, the MCU performs the first preset processing according to the samples to generate a plurality of results of the first preset processing, the CPU fetches the results from the MCU in batches at a third frequency, the first frequency is higher than or equal to the second frequency and the second frequency is higher than or equal to the third frequency.
 3. The mobile device of claim 2, wherein the sensor comprises a second buffer, the sensor stores the samples in the second buffer, and the MCU stores the results in the first buffer.
 4. The mobile device of claim 1, wherein the CPU has more processing power than the MCU does and the CPU consumes more electric power than the MCU does.
 5. The mobile device of claim 1, wherein the CPU sleeps until the CPU wakes up to fetch the result from the MCU or until the CPU is woke up by the signal from the MCU, while the MCU never sleeps.
 6. The mobile device of claim 5, wherein the MCU wakes up the CPU and notifies the CPU to fetch the result from the MCU.
 7. The mobile device of claim 5, wherein the CPU wakes up without notification from the MCU and then the CPU fetches the result from the MCU.
 8. The mobile device of claim 1, wherein the MCU is exclusively dedicated to performing the first preset processing according to the samples and providing the result or the signal to the CPU.
 9. A mobile device, comprising: a sensor, generating a plurality of samples; and a microcontroller unit (MCU), coupled to the sensor, comprising a first buffer, fetching the samples from the sensor, performing a preset processing according to the samples, storing the samples and/or a result of the preset processing in the first buffer, and providing the result or a signal based on the result to an electronic device; wherein the samples are fetched in batches so as to reduce power consumption.
 10. The mobile device of claim 9, wherein the sensor generates the samples at a first frequency, the MCU fetches the samples from the sensor in batches at a second frequency, the MCU performs the preset processing according to the samples to generate a plurality of results of the preset processing, the MCU provides the results to the electronic device in batches at a third frequency, the first frequency is higher than or equal to the second frequency and the second frequency is higher than or equal to the third frequency.
 11. The mobile device of claim 10, wherein the sensor comprises a second buffer, the sensor stores the samples in the second buffer, and the MCU stores the results in the first buffer.
 12. The mobile device of claim 9, wherein the MCU never sleeps and is exclusively dedicated to performing the preset processing according to the samples and providing the result or the signal to the electronic device.
 13. A microcontroller unit (MCU), comprising: a buffer, wherein the MCU fetches a plurality of samples from a sensor, the MCU performs a preset processing according to the samples, the MCU stores the samples or a result of the preset processing in the buffer, and the MCU provides the result or a signal based on the result to an electronic device; wherein the samples are fetched in batches so as to reduce power consumption.
 14. The MCU of claim 13, wherein the sensor generates the samples at a first frequency, the MCU fetches the samples from the sensor in batches at a second frequency, the MCU performs the preset processing according to the samples to generate a plurality of results of the preset processing, the MCU stores the results in the buffer and provides the results to the electronic device in batches at a third frequency, the first frequency is higher than or equal to the second frequency and the second frequency is higher than or equal to the third frequency.
 15. The MCU of claim 13, wherein the MCU never sleeps and is exclusively dedicated to performing the preset processing according to the samples and providing the result or the signal to the electronic device.
 16. A mobile device, comprising: a sensor, generating a plurality of samples; a microcontroller unit (MCU), coupled to the sensor, comprising a first buffer, fetching the samples from the sensor, performing a first preset processing according to the samples, and storing the samples and/or a result of the first preset processing in the first buffer, wherein a number of times the MCU fetches the samples during a first time interval is smaller than a number of times the sensor generates one of the samples during the first time interval; and a central processing unit (CPU), coupled to the MCU, fetching the result from the MCU or receiving a signal based on the result from the MCU, and performing a second preset processing according to the result or the signal, wherein a number of times the CPU fetches the result during a second time interval is smaller than a number of times the MCU fetches the samples during the second time interval; wherein the number of times the MCU fetches the samples during the first time interval is smaller than the number of times the sensor generates one of the samples during the first time interval to reduce power consumption of the mobile device, and the number of times the CPU fetches the result during the second time interval is smaller than the number of times the MCU fetches the samples during the second time interval to reduce power consumption of the mobile device.
 17. The mobile device of claim 16, wherein the sensor generates the samples at a first frequency, the MCU fetches the samples from the sensor in batches at a second frequency, the MCU performs the first preset processing according to the samples to generate a plurality of results of the first preset processing, the CPU fetches the results from the MCU in batches at a third frequency, the first frequency is higher than or equal to the second frequency and the second frequency is higher than or equal to the third frequency.
 18. The mobile device of claim 17, wherein the sensor comprises a second buffer, the sensor stores the samples in the second buffer, and the MCU stores the results in the first buffer.
 19. The mobile device of claim 16, wherein the CPU has more processing power than the MCU does and the CPU consumes more electric power than the MCU does.
 20. The mobile device of claim 16, wherein the CPU sleeps until the CPU wakes up to fetch the result from the MCU or until the CPU is woke up by the signal from the MCU, while the MCU never sleeps.
 21. The mobile device of claim 20, wherein the MCU wakes up the CPU and notifies the CPU to fetch the result from the MCU.
 22. The mobile device of claim 20, wherein the CPU wakes up without notification from the MCU and then the CPU fetches the result from the MCU.
 23. The mobile device of claim 16, wherein the MCU is exclusively dedicated to performing the first preset processing according to the samples and providing the result or the signal to the CPU.
 24. A mobile device, comprising: a sensor, generating a plurality of samples; a microcontroller unit (MCU), coupled to the sensor, comprising a first buffer, fetching the samples from the sensor in batches, performing a first preset processing according to the samples, and storing the samples and/or a result of the first preset processing in the first buffer; and a central processing unit (CPU), coupled to the MCU, fetching the result from the MCU in batches or receiving a signal based on the result from the MCU, and performing a second preset processing according to the result or the signal; wherein the MCU fetches the samples from the sensor in batches, and the CPU fetches the result from the MCU in batches to reduce power consumption of the mobile device. 